import os
from flask import Flask

from apps.extensions import init_plugs
from apps.views import init_view
from apps.configs import load_config


def create_app():
    app = Flask(__name__)

    # 配置
    load_config(app)

    # 注册各种插件
    init_plugs(app)

    # 注册路由
    init_view(app)

    return app
